package com.tj.mapper;

import com.tj.pojo.Category;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tj.pojo.Employee;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author t
* @description 针对表【category(菜品及套餐分类)】的数据库操作Mapper
* @createDate 2023-04-25 21:48:54
* @Entity com.tj.pojo.Category
*/
@Mapper
public interface CategoryMapper {

    @Select("select * from category limit #{page},#{pageSize}")
    public List<Category> getPageCategory(int page, int pageSize);

    @Select("select * from category where name=#{name}")
    public Employee getByName(Category category);

    @Insert("insert into category values (null,#{type},#{name},#{sort},#{createTime},#{updateTime},#{createUser},#{updateUser})")
    public int addCategory(Category category);

    @Delete("delete from category where id=#{id}")
    public int deleteById(Long id);

    @Select("select * from category")
    public List<Category> getAll();
}




